package com.lc.controller;

import ch.qos.logback.core.util.TimeUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * Author:LC
 * Version:jdk-8u301
 * Date: 2022/7/19 10:59
 */
@RestController
public class OrderController {

    /**
     * 总结
     * 浏览器(前端)-------> user-service(/userDoOrder)-----RPC(feign)--->order-service(/doOrder)
     * feign的默认等待时间时1s，超过1s就在直接报错超时
     */
    @GetMapping("/doOrder")
    public String doOrder() throws InterruptedException {
        TimeUnit.SECONDS.sleep(2);
        return "吃饭啦吃饭啦吃饭啦";
    }

}
